function openOrder(type) {
    if (type == 1) { //发布新订单
        window.location.href = "release.html";
    } else if (type == 2) { //我的订单列表
        window.location.href = "order_list.html";
    }
}

function openUser(type) {
    if (type == 1) { //编辑资料
        window.location.href = "person_info.html";
    } else if (type == 2) { //退出登录
        window.location.href = "login_pwd.html";
    }
}

function openAbout(type) {
    if (type == 1) { //企业精神
        window.location.href = "about_us1.html";
    } else if (type == 2) { //企业简介
        window.location.href = "about_us2.html";
    }
}


function openDisplay(type) {
    if (type == 1) {
        about.style.display = 'none';
        user.style.display = 'none';
    } else if (type == 2) {
        order.style.display = 'none';
        user.style.display = 'none';
    } else if (type == 3) {
        order.style.display = 'none';
        about.style.display = 'none';
    }
}
//通用上传图片
function uploadImageCommon(form_id,input_id) {
    var formData = new FormData($( "#"+form_id )[0]);
    var url = '/index/Upload/uploadImgBendi';
    $.ajax({
        url: url,
        data: formData,
        type: 'POST',
        async: false,//1，这四个要写上，否则点击没反应
        cache: false,//2
        contentType: false,//3
        processData: false,//4
        dataType: 'JSON',
        success: function (returnData) {
            if(returnData.code == 1){
                // $( "#"+input_id).val(returnData.msg);
                location.href = '/index/My/goImage?imgsrc='+returnData.msg;
                return true;
            }else{
                alert(returnData.msg);
                return false;
            }
        },
        error: function () {
            alert('服务器错误，请刷新重试！');
            return false;
        }
    })
}
